#ifndef IMAGEGALLERYITEM_H
#define IMAGEGALLERYITEM_H

#include <QWidget>

namespace Jcr
{
class ImageGalleryItemPrivate;
class ImageGalleryItem : public QWidget
{
    Q_OBJECT
public:
    enum State { View, Select, Edit };

    explicit ImageGalleryItem(QWidget* parent = nullptr);
    explicit ImageGalleryItem(const QString& file, QWidget* parent = nullptr);
    ~ImageGalleryItem();

    void setState(State state);
    State state() const;

    void setFile(const QString& file);
    QString file() const;

    bool rename(const QString& newBaseName);
    QString baseName() const;

    void select(bool select);
    bool selected() const;

protected:
    void showEvent(QShowEvent *e);
    void resizeEvent(QResizeEvent* e);
    void mouseDoubleClickEvent(QMouseEvent* e);

private slots:
    void onEditReturnPressed();

private:
    ImageGalleryItemPrivate* d_ptr;
    Q_DISABLE_COPY(ImageGalleryItem)
};

} // namespace jcr
#endif // IMAGEGALLERYITEM_H
